package io.renren.modules.app.wx;

import cn.hutool.core.util.StrUtil;
import io.renren.common.exception.RRException;
import lombok.Getter;

@Getter
public enum WxAppIdEnum {
    //todo 朱子扬 这个要写真实的 微信管理后台可以找到 appId 和 secret 秘钥
    TAI_HUA("wxd6038df909c3903c", "655846d892ee43a21ec6a694dc21a46b", "台化小程序"),
    TAI_HUA_MP("wx82317cb039456dce", "b4e7abd005f942cf14aa31a54926c523", "台化公众号");
    private final String appId;

    private final String secret;

    private final String desc;

    WxAppIdEnum(String appId, String secret, String desc) {
        this.appId = appId;
        this.secret = secret;
        this.desc = desc;
    }

    public static WxAppIdEnum getEnum(String appId) {
        for (WxAppIdEnum value : values()) {
            if (StrUtil.equals(appId, value.getAppId())) {
                return value;
            }
        }
        throw new RRException("appId 配置错误， 请联系管理员");
    }
}
